package com.gk.panda.apis.patrol.controller.client;

import com.gk.panda.apis.patrol.servicr.WeatherService;
import com.gk.panda.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author：xxz
 * @Create: 2022/11/2 18:18
 */
@RestController
@RequestMapping("/weather")
@Api(tags = "天气相关信息Api")
public class WeatherController {

    @Autowired
    private WeatherService weatherService;


    @GetMapping()
    @ApiOperation("根据经纬度获取天气信息")
    public Result<?> getWeather(@RequestParam(required = false, defaultValue = "0") String lon, @RequestParam(required = false, defaultValue = "0") String lat){
        return weatherService.getWeather(lon, lat);
    }


}
